<?php 
	/** http://www.phpddt.com */
    $html = "<meta http-equiv='Content-Type' content='text/html; charset=gbk'>";
    //匹配标准的meta标签
    $pattern = "/<meta\s+http-equiv=(\'|\")?Content-Type(\'|\")?\s+content=(\'|\")text\/html;\s+charset=(.*)(\'|\")>/i";
    $replacement = "<meta http-equiv='Content-Type' content='text/html; charset=big5'>";
    $result = preg_replace($pattern, $replacement, $html);
    echo htmlspecialchars($result);
 ?>